On suspend, canonicalize store and console mfns in the guest.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Mon, 5 Sep 2005 15:32:14 +0000 (15:32 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Mon, 5 Sep 2005 15:32:14 +0000 (15:32 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
tools/libxc/xc_linux_save.c

index 88337fbe29664e2967d8ea40e0da04e6618d0f64..df0d23374824209f48929a0bc6951c6ffc3bbdba 100644 (file)
@@ -177,6 +177,9 @@ static int __do_suspend(void *ignore)
     HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
     clear_fixmap(FIX_SHARED_INFO);
 
+    xen_start_info.store_mfn = mfn_to_pfn(xen_start_info.store_mfn);
+    xen_start_info.console_mfn = mfn_to_pfn(xen_start_info.console_mfn);
+
     /* We'll stop somewhere inside this hypercall.  When it returns,
        we'll start resuming after the restore. */
     HYPERVISOR_suspend(virt_to_mfn(xen_start_info));
index 6eac30606220425f84b5c4b49293d1900b319008..c9af7b0d3b20bc516cb77b58eba3ec24ed9427ba 100644 (file)
@@ -434,9 +434,6 @@ int xc_linux_save(int xc_handle, int io_fd, u32 dom, u32 max_iters,
     /* base of the region in which domain memory is mapped */
     unsigned char *region_base = NULL;
 
-    /* A temporary mapping of the guest's start_info page. */
-    start_info_t *start_info = NULL;
-
     /* number of pages we're dealing with */
     unsigned long nr_pfns;
 
@@ -669,28 +666,6 @@ int xc_linux_save(int xc_handle, int io_fd, u32 dom, u32 max_iters,
         goto out;
     }
 
-    /* Map the suspend-record MFN to pin it. The page must be owned by 
-       dom for this to succeed. */
-    start_info = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
-                                     PROT_READ | PROT_WRITE, 
-                                     ctxt.user_regs.esi);
-    if (!start_info){
-        ERR("Couldn't map start_info page");
-        goto out;
-    }
-
-    /* Canonicalize store mfn. */
-    if ( !translate_mfn_to_pfn(&start_info->store_mfn) ) {
-       ERR("Store frame is not in range of pseudophys map");
-       goto out;
-    }
-
-    /* Canonicalize console mfn. */
-    if ( !translate_mfn_to_pfn(&start_info->console_mfn) ) {
-       ERR("Console frame is not in range of pseudophys map");
-       goto out;
-    }
-
     print_stats( xc_handle, dom, 0, &stats, 0 );
 
     /* Now write out each data page, canonicalising page tables as we go... */
@@ -1062,9 +1037,6 @@ int xc_linux_save(int xc_handle, int io_fd, u32 dom, u32 max_iters,
     if(live_shinfo)
         munmap(live_shinfo, PAGE_SIZE);
 
-    if(start_info) 
-        munmap(start_info, PAGE_SIZE);
-
     if(live_pfn_to_mfn_frame_list) 
         munmap(live_pfn_to_mfn_frame_list, PAGE_SIZE);